<html>
<head><meta charset="utf-8"><title>View assembly generated for standard library · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/View.20assembly.20generated.20for.20standard.20library.html">View assembly generated for standard library</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="223470206"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/View%20assembly%20generated%20for%20standard%20library/near/223470206" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/View.20assembly.20generated.20for.20standard.20library.html#223470206">(Jan 21 2021 at 04:56)</a>:</h4>
<p>Is there an easy way to see what assembly the compiler generates for a function in the standard library?</p>



<a name="223477390"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/View%20assembly%20generated%20for%20standard%20library/near/223477390" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/View.20assembly.20generated.20for.20standard.20library.html#223477390">(Jan 21 2021 at 07:41)</a>:</h4>
<p><a href="http://rust.godbolt.org">rust.godbolt.org</a>, write a function that wraps the one you're interested in, just passing args and return value untouched</p>



<a name="223477421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/View%20assembly%20generated%20for%20standard%20library/near/223477421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/View.20assembly.20generated.20for.20standard.20library.html#223477421">(Jan 21 2021 at 07:42)</a>:</h4>
<p>Assuming it's public, that is. If not, maybe you can copy the code wholesale.</p>



<a name="223477535"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/View%20assembly%20generated%20for%20standard%20library/near/223477535" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/View.20assembly.20generated.20for.20standard.20library.html#223477535">(Jan 21 2021 at 07:44)</a>:</h4>
<p>The playground can show asm too, using the menu next to "run", but godbolt is nicer for this.</p>



<a name="223479045"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/View%20assembly%20generated%20for%20standard%20library/near/223479045" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/View.20assembly.20generated.20for.20standard.20library.html#223479045">(Jan 21 2021 at 08:06)</a>:</h4>
<p>A quick example: <a href="https://rust.godbolt.org/z/4fjTMz">https://rust.godbolt.org/z/4fjTMz</a><br>
(Since I had it available from <a href="https://github.com/rust-lang/rust/pull/81107">a recent PR</a>.  Definitely harder if it's something that's non-inline and non-generic, though.)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>